Skip to content

feat(launch): make Headroom opt-in and wire RTK when the entry file lacks the block - #22

Merged
protonspy merged 1 commit into
mainfrom
launch-headroom-opt-in-rtk-default
Aug 9, 2026
Merged

feat(launch): make Headroom opt-in and wire RTK when the entry file lacks the block#22
protonspy merged 1 commit into
mainfrom
launch-headroom-opt-in-rtk-default

Conversation

@protonspy

Copy link
Copy Markdown
Owner

What a bare scc launch does, and does not, is now settled by one question: does this leave anything behind after the session ends?

Headroom moves behind --headroom

headroom wrap registers MCP servers into the agent's own config, and those registrations outlive the session that made them — which is why Headroom ships unwrap at all. What it buys is one session of compression. That trade is no longer made on the user's behalf: without --headroom, scc does not even look for the binary, and the report omits the headroom field entirely rather than saying skipped — a launch that never considered Headroom and one that considered it and could not use it are different answers.

Any --headroom-* flag implies --headroom, because accepting a flag and then ignoring it is how somebody spends a session believing they configured something. With the flag, the internal defaults are unchanged: --headroom-mcp none and --no-context-tool.

--no-headroom is gone; it has nothing left to turn off.

RTK goes the other way, bounded by the block

scc launch now makes sure the entry file the agent is about to load actually mentions RTK — the same setup scc rtk does standalone. The trigger is the block, not the binary: it runs when an entry file carries none, and does nothing at all when they all do.

That bound is what lets it be the default. It fires once per workspace rather than once per session, so a wired workspace pays no cargo prompt and no edit at the top of every session. The write is the point — an agent that never read the block never types the prefix, so installing the binary and leaving the file alone would buy nothing.

It splices with keep, so a block already there is left exactly as it is even when scc ships a different one. Replacing somebody's block is a real trade-off, and scc rtk is where it is made deliberately, not a side effect of starting an agent. --no-rtk opts out.

Two smaller consequences

  • A plan-only run no longer writes. check now goes through to applyRTK, which closes a real hole: --rtk --dry-run used to splice the entry file — the one flag nobody expects to change anything doing exactly that.
  • Block present, binary absent gets one warning and no action. The file tells the agent to use a binary this machine lacks, but that is a PATH problem on the user's side rather than something to fix mid-launch.

Tests

--no-headroom dropped from 18 incidental call sites, --headroom added to the ones that assert on the wrap. TestLaunchRTKIsOptIn gave way to five tests: writes when the block is missing, leaves a block that is already there byte-identical, --no-rtk omits everything, plan-only writes nothing, and it degrades without cargo.

gofmt, go vet and the full suite are green locally (the race detector needs a C compiler this machine does not have; CI covers it).

🤖 Generated with Claude Code

https://claude.ai/code/session_018CAEQdLsrScdfaa1ut2H7g

…acks the block

What a bare `scc launch` does, and does not, is now settled by one question:
does this leave anything behind after the session ends?

Headroom's `wrap` does — it registers MCP servers into the agent's own config,
and those registrations outlive the session that made them, which is why
Headroom ships `unwrap` at all. What it buys is one session of compression, so
it moves behind `--headroom`; without the flag scc does not even look for the
binary, and the report omits the field entirely rather than saying "skipped".
Any `--headroom-*` flag implies `--headroom`, because accepting a flag and then
ignoring it is how somebody spends a session believing they configured
something. With the flag, the internal defaults are unchanged: `--headroom-mcp
none` and `--no-context-tool`.

RTK goes the other way, and the trigger is the block rather than the binary: it
runs when an entry file carries no RTK block and does nothing at all when they
all do. That bound is what lets it be the default — it fires once per workspace
rather than once per session, so a wired workspace pays no cargo prompt and no
edit at the top of every session. The write is the point: an agent that never
read the block never types the prefix, so installing the binary and leaving the
file alone would buy nothing. It splices with keep, so a block already there is
left exactly as it is even when scc ships a different one; replacing somebody's
block is a real trade-off and `scc rtk` is where it is made deliberately.

Two smaller consequences. A plan-only run now passes check through to applyRTK,
which closes a real hole: `--rtk --dry-run` used to splice the entry file, the
one flag nobody expects to change anything doing exactly that. And a workspace
whose block is present while the binary is not gets one warning and no action —
the file tells the agent to use a binary this machine lacks, but that is a PATH
problem on the user's side rather than something to fix mid-launch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018CAEQdLsrScdfaa1ut2H7g
@protonspy
protonspy merged commit f3f85b6 into main Aug 9, 2026
4 checks passed
@protonspy
protonspy deleted the launch-headroom-opt-in-rtk-default branch August 9, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant